chore: cover realtime tool timeout behaviors in realtime session#3076
chore: cover realtime tool timeout behaviors in realtime session#3076Aphroq wants to merge 2 commits intoopenai:mainfrom
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 25d37238de
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| for _ in range(10): | ||
| if session._event_queue.qsize() >= 3: | ||
| break | ||
| await asyncio.sleep(0.01) |
There was a problem hiding this comment.
Wait deterministically for queued tool-call error event
Replace the fixed 100ms poll loop with a deterministic wait for the RealtimeError event. _on_tool_call_task_done enqueues the error via asyncio.create_task(...), so under load the event may arrive after this loop exits, making next(...RealtimeError...) raise despite correct behavior. This introduces a flaky timeout test.
Useful? React with 👍 / 👎.
Add focused realtime session tests for tool timeout branches. - cover direct _handle_tool_call() behavior for timeout_behavior="raise_exception" - cover async timeout_error_function output handling - cover async on_event() failure propagation into RealtimeError
25d3723 to
82eb4b6
Compare
Summary
This pull request adds focused realtime session coverage for tool timeout branches that were not exercised directly.
Test plan
uv run pytest tests/realtime/test_session.py -qIssue number
N/A
Checks
make lintandmake format